package com.yboot.module.system.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yboot.starter.common.core.web.validation.InsertGroup;
import com.yboot.starter.common.core.web.validation.UpdateGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;

/**
 * 公告表
 * @author yangcs
 * @date 2025-08-29
 */
@Data
public class SysNoticeDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @NotBlank(message = "id不能为空", groups = {UpdateGroup.class})
    private String id;
    /**
     * 标题
     */
    @NotBlank(message = "title不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String title;
    /**
     * 内容
     */
    @NotBlank(message = "content不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String content;
    /**
     * 分类
     */
    @NotBlank(message = "type不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String type;
    /**
     * 通知范围（1：所有人；2：指定用户）
     */
    @NotBlank(message = "noticeScope不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String noticeScope;
    /**
     * 通知用户
     */
    private String noticeUsers;
    /**
     * 通知方式（1：系统消息；2：登录弹窗）
     */
    private String noticeMethods;
    /**
     * 是否定时
     */
    @NotNull(message = "isTiming不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private Boolean isTiming;
    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;
    /**
     * 是否置顶
     */
    @NotNull(message = "isTop不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private Boolean isTop;
    /**
     * 状态（1：草稿；2：待发布；3：已发布）
     */
    @NotBlank(message = "status不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String status;
    /**
     * 删除标识
     */
    private String deleteFlag;
}
